﻿<?xml version="1.0" encoding="utf-8"?>
<Database xmlns="Moregen.Database" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="Moregen.Database database.xsd">
	<FixCase>true</FixCase>
	<Schema>
		<TableSQL>
			SELECT OBJECT_NAME name, case when OBJECT_TYPE='VIEW' then 1 else 0 end IsView, nvl(NUM_ROWS,0) rowcnt
			FROM USER_OBJECTS O, USER_TABLES T
			WHERE O.OBJECT_TYPE IN ('TABLE', 'VIEW')
			AND O.OBJECT_NAME = T.TABLE_NAME(+)
		</TableSQL>
		<ColSQL>
			SELECT TABLE_NAME TableName, COLUMN_NAME ColumnName, DATA_TYPE ColumnType, DATA_PRECISION prec, DATA_SCALE scale,
			case when NULLABLE='Y' then 1 else 0 end IsNullable,
			0 IsComputed,
			0 IsIdentity
			FROM USER_TAB_COLUMNS
		</ColSQL>
		<PKSQL>
			SELECT C.TABLE_NAME TableName, I.COLUMN_NAME ColName, C.INDEX_NAME PkName, I.COLUMN_POSITION keyno, 0 IsClustered
			FROM USER_CONSTRAINTS C, USER_IND_COLUMNS I
			WHERE C.CONSTRAINT_TYPE = 'P'
			AND C.INDEX_NAME = I.INDEX_NAME
			ORDER BY C.TABLE_NAME, I.COLUMN_NAME, I.COLUMN_POSITION
		</PKSQL>
		<FKSQL>
			SELECT C.CONSTRAINT_NAME fk_name, RC.TABLE_NAME primary_table, RC.COLUMN_NAME primary_col1, CC.TABLE_NAME foreign_table, CC.COLUMN_NAME foreign_col1
			FROM USER_CONSTRAINTS C, USER_CONS_COLUMNS CC, USER_CONS_COLUMNS RC
			WHERE C.CONSTRAINT_NAME = CC.CONSTRAINT_NAME
			AND C.R_CONSTRAINT_NAME = RC.CONSTRAINT_NAME
			AND C.CONSTRAINT_TYPE = 'R'
			AND CC.POSITION=1
			AND RC.POSITION=1
		</FKSQL>
		<SeqSQL>
			SELECT OBJECT_NAME name
			FROM USER_OBJECTS
			WHERE OBJECT_TYPE='SEQUENCE'
		</SeqSQL>
	</Schema>
	<Types>
		<DBType>BFILE</DBType>
		<csType>byte[]</csType>
	</Types>
	<Types>
		<DBType>BLOB</DBType>
		<csType>byte[]</csType>
	</Types>
	<Types>
		<DBType>CHAR</DBType>
		<csType>string</csType>
		<csType>char</csType>
		<csType>byte</csType>
	</Types>
	<Types>
		<DBType>CLOB</DBType>
		<csType>string</csType>
		<csType>byte[]</csType>
	</Types>
	<Types>
		<DBType>DATE</DBType>
		<csType>DateTime</csType>
	</Types>
	<Types>
		<DBType>FLOAT</DBType>
		<csType>float</csType>
		<csType>decimal</csType>
		<csType>double</csType>
	</Types>
	<Types>
		<DBType>INTEGER</DBType>
		<csType>int</csType>
		<csType>long</csType>
		<csType>Int32</csType>
		<csType>Int64</csType>
		<csType>uint</csType>
		<csType>ulong</csType>
	</Types>
	<Types>
		<DBType>LONG</DBType>
		<csType>string</csType>
		<csType>byte[]</csType>
	</Types>
	<Types>
		<DBType>LONG RAW</DBType>
		<csType>byte[]</csType>
	</Types>
	<Types>
		<DBType>NCHAR</DBType>
		<csType>string</csType>
		<csType>char</csType>
		<csType>byte</csType>
	</Types>
	<Types>
		<DBType>NCLOB</DBType>
		<csType>string</csType>
		<csType>byte[]</csType>
	</Types>
	<Types>
		<DBType>NUMBER</DBType>
		<csType>decimal</csType>
		<csType>float</csType>
		<csType>double</csType>
		<csType>int</csType>
		<csType>long</csType>
	</Types>
	<Types>
		<DBType>NVARCHAR2</DBType>
		<csType>string</csType>
	</Types>
	<Types>
		<DBType>RAW</DBType>
		<csType>byte[]</csType>
	</Types>
	<Types>
		<DBType>ROWID</DBType>
		<csType>string</csType>
	</Types>
	<Types>
		<DBType>UROWID</DBType>
		<csType>string</csType>
	</Types>
	<Types>
		<DBType>VARCHAR</DBType>
		<csType>string</csType>
	</Types>
	<Types>
		<DBType>VARCHAR2</DBType>
		<csType>string</csType>
	</Types>
	<Types>
		<DBType>XMLTYPE</DBType>
		<csType>string</csType>
	</Types>
</Database>